<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.prime.com.tr/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	template="Layout.xhtml">

<ui:define name="metadata">
	<f:event listener="#{sessionBean.isLoggedIn}" type="preRenderView" />
	</ui:define>

	
		<ui:define name="content">
			<h:form prependId="false">
				<p:dataTable id="bookingTable" dynamic="true" var="event"
					value="#{bookings.bookings}"
					selection="#{bookings.selectedBookings}">

					<f:facet name="header">  
             Meine Buchungen  
        </f:facet>

					<!--  <p:column style="width:16px">
				<p:rowToggler />
			</p:column> -->

					<p:column selectionMode="multiple" />

					<p:column>
						<f:facet name="header">  
                    Name  
            </f:facet>
						<h:outputText value="#{event.name}" />
					</p:column>

					<p:column>
						<f:facet name="header">  
                    Datum  
            </f:facet>
						<h:outputText value="#{event.date}" />
					</p:column>

					<p:column>
						<f:facet name="header">  
                    Ort  
            		</f:facet>
						<h:outputText value="#{event.location}" />
					</p:column>

					<p:column>
						<f:facet name="header">  
                    Preis  
            		</f:facet>
						<h:outputText value="#{event.pricePerTicket}" />
					</p:column>
					<f:facet name="footer">
						<p:commandButton id="deleteBtn" value="Löschen"
							action="#{bookings.delete}" update="bookingTable" />
					</f:facet>
				</p:dataTable>
			</h:form>
		</ui:define>

</ui:composition>